<div class="col-lg-12">

	<!--当前位置 start-->
	<div class="row">
		<div class="col-lg-12">
			<ol class="breadcrumb">
				<li><i class="fa fa-home mrg-r-sm"></i>首页</li>
				<li class="active"><span>服务方案列表</span></li>
			</ol>
			<div class="filter-block pull-left">
				<!--搜索框 Start1-->
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.start_time" id="start_time" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" data-date-format="yyyy-mm-dd"  placeholder="请输入开始时间">
				</div>
				<div class="form-group pull-left">
					~
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.end_time" id="end_time"  onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" data-date-format="yyyy-mm-dd"  placeholder="请输入结束时间">
				</div>
				<!--<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.order_id"  placeholder="请输入订单号">
				</div>-->
                <div class="form-group pull-left">
                    <input type="text" class="form-control" ng-model="search.card_number"  placeholder="请输入八位数的会员卡号">
                </div>
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.username"  placeholder="请输入联系人" >
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.phone"  placeholder="请输入电话">
				</div>
				<div class="form-group pull-left" ng-if="manageName == 'admin'">
					<input type="text" class="form-control" ng-model="search.selected_company_name"  placeholder="请输入服务商">
				</div>

                <div class="form-group pull-left" ng-if="manageName=='allTest'">
                    <select class="form-control" ng-model="search.filter_manage_account_id">
                        <option value="all" selected="selected">查看所有话务员的订单</option>
                        <option value="mine">只看自己的订单</option>
                    </select>
                </div>
				<div class="form-group pull-left" >
					<select class="form-control"  ng-model="search.status">
						<option value="">请选择订单状态</option>
						<option value="待受理" >待受理</option>
					    <option value="已接单">已接单</option>
					    <option value="试工中"  >试工中</option>
					   <!-- <option  value="服务中" >服务中</option>-->
					    <option value="完成" >完成</option>
					    <option value="待回访" >待回访</option>
					    <option value="终止订单" >终止订单</option>
					    <option value="终止审核" >终止审核</option>
					    <option value="已删除" >已删除</option>
					    <option value="退单" >退单</option>
					</select>
				</div>
				<div class="form-group pull-left"  style="display: none;">
					<select class="form-control"  ng-model="search.company" ng-options="company.name for company in companylist"  >
						<option value="">请选择受理企业</option>
					</select>
				</div>
    			<div class="form-group pull-left">
    					
					<select class="form-control" ng-model="search.serviceType1"  ng-change="serviceType(search.serviceType1.code, 1)" ng-options=" service1 as service1.title for service1 in serviceType1List"  >
					    <option value="">请选择服务项目</option>
					</select>
				</div>
				<div class="form-group pull-left">
					<select class="form-control"  ng-model="search.serviceType2" ng-change="serviceType(search.serviceType2.code, 2)" ng-options=" service2 as service2.title for service2 in serviceType2List" >
						<option value="">请选择服务项目</option>
					</select>
				</div>
				<div class="form-group pull-left">
					<select class="form-control"  ng-model="search.serviceType3"  ng-options=" service3 as service3.title for service3 in serviceType3List" >
						<option value="">请选择服务项目</option>
					</select>
				</div>
				
				
				
				<!--搜索框 End-->
				<div class="pull-left" >
					<a class="btn btn-success pull-left" id="sousuo" ng-click="filter()">
						 <i class="fa fa-search search-icon"></i> 搜索
					 </a>
					 <a class="btn btn-primary pull-left mrg-b-lg md-trigger" ng-click="export(search, search)" id="show" >
						<i class="fa  fa-minus-circle fa-lg"></i> 导出
					</a>
					<div id="range-ul" class=" pull-left col-lg-3" ng-show="export_clicked== 1">
						<div class="col-lg-6" >
							<style>
								#url:focus {
									color: #fff;
								}
							</style>
							<a class="btn btn-info pull-left " ng-if="export_url!=''" id='url' ng-href="{{export_url}}">
                                <i class="fa fa-download fa-lg"></i> 点击下载
                            </a>
							<a class="btn btn-info  pull-left " ng-if="export_url==''">
                                <i class="fa fa-download fa-lg"></i> 正在请求
                            </a>
                            </br>
					    </div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--当前位置 end-->
	
	<!--代码写在这里-->
	<div class="row">
			<div class="col-lg-12">
				<div class="main-box no-header clearfix">
				
					<div class="main-box-body clearfix" >
						<div class="table-responsive">
							<table class="table table-hover table-striped text-center">
								<thead >
									<tr>
										<th class="text-center"><span>订单号</span></th>
										<th class="text-center"><span>服务项目</span></th>
										<th class="text-center"><span>联系人</span></th>
										<th class="text-center"><span>会员卡号</span></th>
										<th class="text-center"><span>联系电话</span></th>
										<th class="text-center"><span>预约时间</span></th>
										<th class="text-center"><span>下单时间</span></th>
										<th class="text-center"><span>订单状态</span></th>
										<th class="text-center" ng-if="manageName == 'admin'"><span>服务商/服务站</span></th>
										<!--<th class="text-center"><span>当前服务人员</span></th>-->
										<th class="text-center"><span>满意程度</span></th>
										<th class="text-center"><span>话务员</span></th>
										<th class="text-center"><span>操作</span></th>
									</tr>
								</thead>
								<tbody>
									<tr role="row" class="odd" ng-repeat="item in list" id="{{item.order_id}}">
										<td>
                                            <span ng-if="item.status == '待受理'"  class="order-attention">
                                                {{item.order_id}}
                                            </span>
                                            <span ng-if="item.status != '待受理'">
                                                {{item.order_id}}
                                            </span>
										</td>
										<td>{{item.serviceType3_title}}</td>
										<td>{{item.name}}</td>
										<td>{{item.card_number}}</td>
										<td>{{item.phone}}</td>
										<td>{{item.time}}</td>
										<td>{{item.create_time}}</td>
										<td ng-if="item.score == 0"><span class="label label-danger">{{item.status}}</span></td>
										<td ng-if="item.score != 0"><span class="label label-default">{{item.status}}</span></td>
										<td  ng-if="manageName == 'admin'">{{item.selected_company_name}}</td>
										<!--<td>{{item.selected_servant_name}}</td>-->
										<td ng-if="item.score == 0" style="color: red;">投诉(不满意)</td>
										<td ng-if="item.score == 1">不满意</td>
										<td ng-if="item.score == 3">满意</td>
										<td ng-if="item.score == 5">非常满意</td>
										<td ng-if="item.score == undefined && item.score == null "></td>
										<td ng-if="item.score == 2 || item.score == 4"></td>
										<td>{{item.record_manager_account}}</td>
										<td>
											<!--<a class="btn  btn-primary" href="#/orderEdit/detail/{{item.order_id}}">详情</a> <!---->
                							<a  class="btn  btn-primary" href="#/orderEdit/supervise/{{item.order_id}}">督办</a>
                							<a  ng-if="item.status=='待回访' || item.status=='终止订单'" class="btn  btn-primary" href="#/orderEdit/visit/{{item.order_id}}">回访</a>
                							<a  ng-if="item.status =='终止审核'" class="btn  btn-primary" ng-click="stopOrder(item.reason,'终止订单',item.order_id)">审核通过</a>
                							<a  ng-if="item.status =='退单审核'" class="btn  btn-primary" ng-click="stopOrder(item.reason,'已退单',item.order_id)">审核通过</a>
                                            <a  ng-if="item.status!='终止审核' && item.status!='退单审核'&& item.status!='终止订单'&&item.status !='已退单'" class="btn  btn-primary" ng-click="openWindow(item.order_id)">终止订单</a>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<ul class="pagination pull-right">
                            <li><a >总条数：{{count}}</a></li>
                            <li><a >总页数：{{totalPage}}</a></li>
					        <li><a ng-click="changePage(1)">首页</a></li>
					        <li><a ng-show="currentPage>1" ng-click="changePage(currentPage-1)"><i class="fa fa-chevron-left"></i></a></li>
					        <!--<li><span ng-show="frontdotShow">…</span></li>-->
					        <li ng-repeat="item in pageList" ng-click="changePage(item.number)" class="{{item.active}}"><a>{{item.number}}</a></li>
					        <!--<li><span ng-show="backdotShow">…</span></li>-->
					        <li><a ng-show="currentPage<totalPage" ng-click="changePage(currentPage+1)"><i class="fa fa-chevron-right"></i></a></li>
					        <li><a ng-click="changePage(totalPage)">尾页</a></li>
					    </ul>
					</div>
				</div>
			</div>
		</div>
	<!--代码写在这里  end-->

	<style>
		.modal-backdrop {
			position: fixed;
			top: 0;
			bottom: 0;
			left: 0;
			right: 0;
		}
		.modal-dialog {
			margin-top: 15%;
		}
	</style>
	<div class="modal fade" id="back-order-dialog" role="dialog" aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">终止订单\退单页面</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<div class="form-group">
							<label for="back-order-reason">终止订单\退单原因</label>
							<input type="text" class="form-control" id="back-order-reason" value="" autofocus="autofocus" ng-model="reason">
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="saveBackOrder(reason,'终止审核')">终止订单</button>
					<!--<button type="button" class="btn btn-primary" ng-click="saveBackOrder(reason,'退单审核')">退单</button>-->
				</div>
			</div>
		</div>
	</div>
</div>

